<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="商品名称" prop="name">
        <el-input
          v-model="queryParams.name"
          placeholder="请输入商品名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="商品类型" prop="type">
        <el-input
          v-model="queryParams.type"
          placeholder="请输入商品类型"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="品牌信息" prop="brand">
        <el-input
          v-model="queryParams.brand"
          placeholder="请输入品牌信息"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="商品状态" prop="status">
        <el-select v-model="queryParams.status" placeholder="请选择商品状态" clearable>
          <el-option
            v-for="dict in dict.type.sys_normal_disable"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="搜索关键字" prop="keywords">
        <el-input
          v-model="queryParams.keywords"
          placeholder="请输入搜索关键字"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['product:info:add']"
        >新增
        </el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['product:info:edit']"
        >修改
        </el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['product:info:remove']"
        >删除
        </el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['product:info:export']"
        >导出
        </el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="infoList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center"/>
      <el-table-column label="ID" align="center" prop="id"/>
      <el-table-column label="商品名称" align="center" prop="name"/>
      <el-table-column label="商品类型" align="center" prop="type"/>
      <el-table-column label="单位" align="center" prop="unit"/>
      <el-table-column label="商品主图" align="center" prop="img" width="100">
        <template slot-scope="scope">
          <image-preview :src="scope.row.img" :width="50" :height="50"/>
        </template>
      </el-table-column>
      <el-table-column label="商品轮播图" align="center" prop="carouselImages" width="100">
        <template slot-scope="scope">
          <image-preview :src="scope.row.carouselImages" :width="50" :height="50"/>
        </template>
      </el-table-column>
      <el-table-column label="品牌信息" align="center" prop="brand"/>
      <el-table-column label="商品状态" align="center" prop="status">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
        </template>
      </el-table-column>
      <el-table-column label="商品描述" align="center" prop="productDesc"/>
      <el-table-column label="搜索关键字" align="center" prop="keywords"/>
      <el-table-column label="规格信息" align="center" prop="ruleId"/>
      <el-table-column label="操作1" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            v-if="scope.row.status == 0"
            icon="el-icon-upload"
            @click="handleUpload(scope.row)"
          >下架
          </el-button>
          <el-button
            size="mini"
            type="text"
            v-if="scope.row.status == 1"
            icon="el-icon-upload"
            @click="handleUpload(scope.row)"
          >上架
          </el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['product:info:edit']"
          >修改
          </el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['product:info:remove']"
          >删除
          </el-button>
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改商品信息对话框 -->
    <el-dialog :title="title" :visible.sync="open" :fullscreen="true" width="80%" append-to-body>
      <el-steps :active="productActive" finish-status="success">
        <el-step title="商品信息"></el-step>
        <el-step title="商品SKU"></el-step>
        <el-step title="商品描述"></el-step>
      </el-steps>
      <el-form ref="form" :model="form" :rules="rules" label-width="120px">
        <div v-show="productActive == 1">
          <el-row :gutter="20">
            <el-col :span="12">
              <el-form-item label="商品名称" prop="name">
                <el-input v-model="form.name" placeholder="请输入商品名称"/>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="搜索关键字" prop="keywords">
                <el-input v-model="form.keywords" placeholder="请输入搜索关键字"/>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row :gutter="20">
            <el-col :span="12">
              <el-form-item label="商品类型" prop="type">
                <el-cascader style="width: 100%;"
                             v-model="productTypeValus"
                             :options="productTypeTree"
                             :props="{'value':'id','label':'name'}"
                             @change="changeProductType"></el-cascader>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="单位" prop="unit">
                <el-input v-model="form.unit" placeholder="请输入单位"/>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row :gutter="20">
            <el-col :span="12">
              <el-form-item label="品牌信息" prop="brand">
                <el-select style="width: 100%"
                           v-model="form.brand"
                           filterable
                           remote
                           reserve-keyword
                           placeholder="请输入关键词"
                           :remote-method="remoteProductBrand"
                           :loading="loading">
                  <el-option
                    v-for="productBrand in productBrandList"
                    :key="productBrand.id"
                    :label="productBrand.name"
                    :value="productBrand.id">
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="商品状态">
                <el-radio-group v-model="form.status">
                  <el-radio
                    v-for="dict in dict.type.sys_normal_disable"
                    :key="dict.value"
                    :label="dict.value"
                  >{{ dict.label }}
                  </el-radio>
                </el-radio-group>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row :gutter="20">
            <el-col :span="24">
              <el-form-item label="商品主图" prop="img">
                <image-upload v-model="form.img" :is-show-tip="false" :limit="1"/>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row :gutter="20">
            <el-col :span="24">
              <el-form-item label="商品轮播图" prop="carouselImages">
                <image-upload v-model="form.carouselImages" :is-show-tip="false" :limit="5"/>
              </el-form-item>
            </el-col>
          </el-row>
        </div>

        <div v-show="productActive == 2">
          <el-row :gutter="20">
            <el-col :span="24">
              <el-form-item label="规格信息" prop="ruleId">
                <el-select v-model="form.ruleId" style="width: 100%;" @change="selectProductRule">
                  <el-option
                    v-for="productRule in productRuleList"
                    :value="productRule.id"
                    :key="productRule.id"
                    :label="productRule.name"></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row :gutter="20">

            <el-form :inline="true" :model="uniteSku" class="demo-form-inline">
              <el-col :span="4">
                <el-form-item label="规格图片">
                  <image-upload v-model="uniteSku.image" :is-show-tip="false" :limit="1"/>
                </el-form-item>
              </el-col>

              <el-col :span="20">
                <el-form-item label="商品库存">
                  <el-input-number v-model="uniteSku.stock" :min="0" :max="10" label="描述文字"></el-input-number>
                </el-form-item>
                <el-form-item label="商品价格">
                  <el-input-number v-model="uniteSku.price" :min="0" :max="10" label="描述文字"></el-input-number>
                </el-form-item>
                <el-form-item label="商品进价">
                  <el-input-number v-model="uniteSku.purchasePrice" :min="0" :max="10" label="描述文字"></el-input-number>
                </el-form-item>
                <el-form-item label="商品售价">
                  <el-input-number v-model="uniteSku.sellingPrice" :min="0" :max="10" label="描述文字"></el-input-number>
                </el-form-item>
                <el-form-item label="规格重量">
                  <el-input-number v-model="uniteSku.weight" :min="0" :max="10" label="描述文字"></el-input-number>
                </el-form-item>
                <el-form-item label="规格体积">
                  <el-input-number v-model="uniteSku.volume" :min="0" :max="10" label="描述文字"></el-input-number>
                </el-form-item>
              </el-col>
            </el-form>
          </el-row>
          <el-row :gutter="20">
            <el-col :span="20" style="height: 1px"></el-col>
            <el-col :span="4">
              <el-button @click="oneClickSettings">一键设置</el-button>
              <el-button @click="oneClickClear">一键清空</el-button>
            </el-col>
          </el-row>
          <el-row :gutter="20">
            <el-table :data="skuDataList" max-height="330px">
              <el-table-column v-for="skuTitle in skuTitleList"
                               :prop="skuTitle.prop" :label="skuTitle.label">
                <template slot-scope="scope">
                  <image-upload v-if="skuTitle.prop == 'image'" v-model="scope.row[skuTitle.prop]" :is-show-tip="false"
                                :limit="1"/>
                  <span v-else-if="skuTitle.prop.indexOf('prop') > -1">{{ scope.row[skuTitle.prop] }}</span>
                  <el-input v-else-if="skuTitle.prop == 'number'" v-model="scope.row[skuTitle.prop]"></el-input>
                  <el-button v-else-if="skuTitle.prop == 'option' && scope.row['stock'] > 0"
                             @click="scope.row['stock'] = 0">售空
                  </el-button>
                  <span v-else-if="skuTitle.prop == 'option' && scope.row['stock'] == 0">已售空</span>
                  <el-input-number v-else v-model="scope.row[skuTitle.prop]" style="width: 150px;"
                                   :min="0" :max="10" label="描述文字"></el-input-number>
                </template>
              </el-table-column>
            </el-table>
          </el-row>
        </div>
        <div v-show="productActive == 3">
          <el-row :gutter="20">
            <el-col :span="24">
              <el-form-item label="商品描述" prop="productDesc">
                <editor v-model="form.productDesc" :min-height="400"/>
              </el-form-item>
            </el-col>
          </el-row>
        </div>

      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button style="margin-top: 12px;" v-if="productActive > 1" @click=" --productActive">上一步</el-button>
        <el-button style="margin-top: 12px;" v-if="productActive < 3" @click="next()">下一步</el-button>
        <el-button type="primary" @click="submitForm" v-if="productActive == 3">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import {listInfo, getInfo, delInfo, addInfo, updateInfo,uploadInfo} from "@/api/product/info";
import {listBrand} from "@/api/product/brand";
import {treeType} from "@/api/product/type";
import {allRule} from "@/api/product/rule";

export default {
  name: "Info",
  dicts: ['sys_normal_disable'],
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 商品信息表格数据
      infoList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        name: null,
        type: null,
        brand: null,
        status: null,
        keywords: null,
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        name: [
          {required: true, message: "商品名称不能为空", trigger: "blur"}
        ],
        type: [
          {required: true, message: "商品类型不能为空", trigger: "blur"}
        ],
        unit: [
          {required: true, message: "单位不能为空", trigger: "blur"}
        ],
        img: [
          {required: true, message: "商品主图不能为空", trigger: "blur"}
        ],
        carouselImages: [
          {required: true, message: "商品轮播图不能为空", trigger: "blur"}
        ],
        brand: [
          {required: true, message: "品牌信息不能为空", trigger: "blur"}
        ],
        status: [
          {required: true, message: "商品状态不能为空", trigger: "blur"}
        ],
        productDesc: [
          {required: true, message: "商品描述不能为空", trigger: "blur"}
        ],
        keywords: [
          {required: true, message: "搜索关键字不能为空", trigger: "blur"}
        ],
        ruleId: [
          {required: true, message: "规格信息不能为空", trigger: "blur"}
        ],
        createBy: [
          {required: true, message: "创建人不能为空", trigger: "blur"}
        ],
        createTime: [
          {required: true, message: "创建时间不能为空", trigger: "blur"}
        ],
      },
      productActive: 1,
      // 商品远程搜索关键词
      productBrandParam: '',
      // 商品品牌集合
      productBrandList: [],
      // 品牌延迟执行器
      brandTimeOut: null,
      // 商品类型集合
      productTypeTree: [],
      //选中类型值
      productTypeValus: [],
      // 商品规格集合
      productRuleList: [],
      // 统一设置对象
      uniteSku: {
        stock: 0,
        price: 0,
        purchasePrice: 0,
        sellingPrice: 0,
        image: '',
        weight: 0,
        volume: 0
      },
      // 表头集合
      skuTitleList: [],
      // 表头模板
      skuTitleTemplateList: [
        {"prop": 'image', "label": '规格图片'},
        {"prop": 'stock', "label": '商品库存'},
        {"prop": 'price', "label": '商品价格'},
        {"prop": 'purchasePrice', "label": '商品进价'},
        {"prop": 'sellingPrice', "label": '商品售价'},
        {"prop": 'weight', "label": '重量'},
        {"prop": 'volume', "label": '体积'},
        {"prop": 'option', "label": '操作'}
      ],
      // sku数据集合
      skuDataList: [],
      // SKU模板对象
      skuTemplate: {
        stock: 0,
        price: 0,
        purchasePrice: 0,
        sellingPrice: 0,
        image: '',
        weight: 0,
        volume: 0
      },
      // 暂存当前SKU的表头集合
      skuPropList: []
    };
  },
  created() {
    this.getList();
    this.initProductTypeTree();
    this.initAllRuleList();
  },
  methods: {
    // 下一步
    next() {
      let nextStatus = true;
      let props = [];
      if (this.productActive == 1) {
        props = ['name', 'keywords', 'brand', 'type', 'unit', 'img', 'carouselImages'];
      } else if (this.productActive == 2) {
        props = ['ruleId']
      }
      this.$refs["form"].validateField(props, (msg) => {
        if (msg != null && msg.length > 0) {
          nextStatus = false;
        }
      })
      if (nextStatus) {
        ++this.productActive;
      }
    },
    // 一键清空
    oneClickClear() {
      this.uniteSku = {
        stock: 0,
        price: 0,
        purchasePrice: 0,
        sellingPrice: 0,
        image: '',
        weight: 0,
        volume: 0
      };
      this.oneClickSettings();
    },
    // 一键设置
    oneClickSettings() {
      this.skuDataList.forEach(skuData => {
        for (let key in this.uniteSku) {
          skuData[key] = this.uniteSku[key]
        }
      })
    },
    // 生成动态表头
    genTitle(ruleId) {
      var productRule;
      this.productRuleList.forEach(proRule => {
        if (proRule.id === ruleId) {
          productRule = proRule
        }
      })
      const ruleAttrList = JSON.parse(productRule.ruleAttr)
      // 表头集合
      this.skuTitleList = []
      // sku 属性二维数组
      var ruleValueList = [];
      this.skuPropList = []
      ruleAttrList.forEach(({ruleType, ruleAttrList}, index) => {
        this.skuTitleList.push({"prop": 'prop' + index, "label": ruleType})
        this.skuPropList.push('prop' + index)
        ruleValueList.push(ruleAttrList)
      })
      this.skuTitleTemplateList.forEach(skuTitleTemplate => this.skuTitleList.push(skuTitleTemplate))
      console.log(this.skuTitleList)
      return ruleValueList
    },
    // 选择规格信息
    selectProductRule(productRuleId) {
      this.oneClickClear()
      this.skuDataList = []
      var ruleValueList = this.genTitle(productRuleId)
      // sku 表格总长度
      var skuDataCount = 1;
      ruleValueList.forEach((ruleValue) => {
        skuDataCount = skuDataCount * ruleValue.length;
      })
      for (let i = 0; i < skuDataCount; i++) {
        this.skuDataList.push({...this.skuTemplate})
      }
      // 使用穷举 填充SKU
      for (let index = 0; index < ruleValueList.length; index++) {
        // 循环次数 -> 数组
        let forSize = 1;
        if (index > 0) {
          for (let forIndex = 0; forIndex < index; forIndex++) {
            forSize = forSize * ruleValueList[forIndex].length;
          }
        }
        // 出现次数 -> 元素
        let showSize = 1;
        if (index < ruleValueList.length - 1) {
          for (let showIndex = index + 1; showIndex < ruleValueList.length; showIndex++) {
            showSize = showSize * ruleValueList[showIndex].length;
          }
        }
        console.log("当前数组：{" + ruleValueList[index].toString() + "}，循环次数：{" + forSize + "} 出现次数：{" + showSize + "}")
        var skuDataIndex = 0;
        // 循环次数
        for (let forIndex = 0; forIndex < forSize; forIndex++) {
          // 数组循环
          ruleValueList[index].forEach((ruleValue) => {
            // 元素出现次数
            for (let showIndex = 0; showIndex < showSize; showIndex++) {
              this.skuDataList[skuDataIndex++]['prop' + index] = ruleValue;
            }
          })
        }
      }
    },
    // 初始化规格信息
    initAllRuleList() {
      allRule().then(response => {
        const respRuleList = response.data;
        respRuleList.forEach(respRule => {
          // 获取到规格类型详情，得到规格集合
          const ruleAttrList = JSON.parse(respRule.ruleAttr);
          var ruleTypeList = [];
          ruleAttrList.forEach(({ruleType, ruleAttrList}) => {
            ruleTypeList.push(ruleType + "(" + ruleAttrList.toString() + ")")
          })
          respRule.name = respRule.name + " - " + ruleTypeList.toString()
        })
        this.productRuleList = respRuleList
      })
    },
    // 选择商品类型
    changeProductType(value) {
      this.form.typeIds = this.productTypeValus.toString()
      this.form.type = this.productTypeValus[this.productTypeValus.length - 1]
    },
    // 初始化商品类型
    initProductTypeTree() {
      treeType().then(response => {
        this.productTypeTree = response.data
      })
    },
    // 商品远程搜索
    remoteProductBrand(query) {
      console.log(query)
      this.productBrandParam = query;
      if (this.brandTimeOut != null) {
        this.cleanBrandTimeOut()
      }
      this.brandTimeOut = setTimeout(this.searchProductBrand, 1000)
    },
    searchProductBrand() {
      listBrand({"name": this.productBrandParam}).then(response => {
        this.productBrandList = response.rows
        this.cleanBrandTimeOut()
      })
    },
    cleanBrandTimeOut() {
      clearTimeout(this.brandTimeOut)
      this.brandTimeOut = null
    },
    /** 查询商品信息列表 */
    getList() {
      this.loading = true;
      listInfo(this.queryParams).then(response => {
        this.infoList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        name: null,
        type: null,
        unit: null,
        typeIds: null,
        img: null,
        carouselImages: null,
        commentCount: null,
        collectCount: null,
        brand: null,
        status: "0",
        productDesc: null,
        keywords: null,
        ruleId: null,
        revision: null
      };
      this.resetForm("form");
      this.productActive = 1;
      this.skuDataList = []
      this.productTypeValus = []
      this.uniteSku = {
        stock: 0,
        price: 0,
        purchasePrice: 0,
        sellingPrice: 0,
        image: '',
        weight: 0,
        volume: 0
      }
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length !== 1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加商品信息";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids
      getInfo(id).then(response => {
        this.form = response.data;
        this.open = true;
        this.productTypeValus = []
        this.form.typeIds.split(",").forEach(value => this.productTypeValus.push(parseInt(value)))
        let skuInfoList = response.data.skuInfoList;
        skuInfoList.forEach(skuInfo => {
          let skuValues = skuInfo.sku.split(",");
          skuValues.forEach((skuValue, index) => {
            skuInfo['prop' + index] = skuValue
          })
        })
        this.skuDataList = skuInfoList
        this.genTitle(response.data.ruleId);
        console.log(this.skuPropList)
        console.log(this.productTypeValus)
        this.title = "修改商品信息";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          this.skuDataList.forEach(skuData => {
            let skuList = []
            console.log(this.skuPropList)
            this.skuPropList.forEach(skuProp => {
              skuList.push(skuData[skuProp])
            })
            console.log(skuList.toString())
            skuData["sku"] = skuList.toString()
          })
          this.form.skuInfoList = this.skuDataList

          if (this.form.id != null) {
            updateInfo(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addInfo(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认删除商品信息编号为"' + ids + '"的数据项？').then( ()=> {
         delInfo(ids).then((res)=>{
           this.getList();
           this.$modal.msgSuccess("删除成功");
         });

      }).catch(() => {
      });
    },
    /** 上架按钮操作 */
    handleUpload: function (row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认上架商品信息编号为"' + ids + '"的数据项？').then(() => {
        uploadInfo(ids).then((res) => {
          let code = res.code;
          if (code != 200) {
            this.$modal.msgError(res.msg);
            return;
          }
          this.getList();
          this.$modal.msgSuccess("上架成功");
        });
      }).catch(() => {
      });
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('product/info/export', {
        ...this.queryParams
      }, `info_${new Date().getTime()}.xlsx`)
    }
  }
};
</script>
<style>
.el-row {
  margin-bottom: 20px;

}
:last-child {
  margin-bottom: 0;
}

.el-col {
  border-radius: 4px;
}

.bg-purple-dark {
  background: #99a9bf;
}

.bg-purple {
  background: #d3dce6;
}

.bg-purple-light {
  background: #e5e9f2;
}

.grid-content {
  border-radius: 4px;
  min-height: 36px;
}

.row-bg {
  padding: 10px 0;
  background-color: #f9fafc;
}
</style>
